package com.kuang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @program: SpringMVC
 * @description:
 * @author: 陈恩涛
 * @create: 2020-07-31 07:27
 **/
@Controller
@RequestMapping("/hello")
public class HelloController {

    //localhost:8088/hello/h1
    @RequestMapping("/h1")
    public String hello(Model model) {
        //封装数据
        model.addAttribute("msg","Hello,SpringMVCAnnotation!");

        return "hello"; //会被视图解析器处理
    }
}
